package com.ICOM5995.P1.helpers;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.HttpURLConnection;

public class Connector {

	
	public void connect(String site)
	{
		HttpURLConnection conn = null;
		
		try {
			URL url = new URL(site);
			conn = (HttpURLConnection) url.openConnection();
			
			System.out.println(conn.getResponseCode());
			
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		finally
		{
			conn.disconnect();
			System.out.println("Disconnected");
		}
	}
	
}
